package cn.iocoder.yudao.module.trade.order.vo;

import cn.iocoder.yudao.framework.common.enums.TerminalEnum;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.framework.validation.PhoneNumber;
import cn.iocoder.yudao.module.api.trade.order.enums.TradeOrderRefundStatusEnum;
import cn.iocoder.yudao.module.api.trade.order.enums.TradeOrderStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 交易订单的分页 Request VO")
@Data
public class TradeOrderPageReqVO extends PageParam {

    @Schema(description = "订单号", example = "88888888")
    private String no;

    @Schema(description = "店铺编号", example = "1024")
    private Long shopId;

    @Schema(description = "用户编号", example = "1024")
    private Long userId;

    @Schema(description = "用户昵称", example = "羡民")
    private String userNickname;

    @Schema(description = "用户电话", example = "15285116029")
    @PhoneNumber
    private String userMobile;

    @Schema(description = "配送类型/服务方式：0-无、1-快递发货、2-到店自提、3-同城配送、4-现场核销、5-上门服务", example = "0")
    private Integer deliveryType;

    @Schema(description = "发货快递公司编号", example = "1")
    private Long logisticsId;

    @Schema(description = "自提门店编号", example = "1,2")
    private Long pickUpStoreId;

    @Schema(description = "自提门店编号", example = "1,2")
    private List<Long> pickUpStoreIds;

    @Schema(description = "核销码/取件码/取餐号", example = "5201314")
    private String verifyCode;

    @Schema(description = "订单类型：0-普通、1-秒杀、2-砍价、3-拼团、4-积分兑换、5-联盟豆兑换、6-团购、10-外送、20-美食、30-酒店、40-娱乐、50-家政、999-赠品", example = "0")
    private Integer type;

    @Schema(description = "订单状态：不传/空串/all-全部、payment-待支付、deliver-待配送、receive-待收货、clerk-待核销、comment-待评价、return-售后、complete-已完成", example = "payment")
    private String orderStatus;

    @Schema(description = "订单状态：0-待付款、10-已付款（待发货、待配送、待上门）、20-进行中（运送中、配送中、服务中、待核销）、30-已完成（已收货、已服务、已取餐、已核销）、40-已关闭", example = "0")
    @InEnum(value = TradeOrderStatusEnum.class, message = "订单状态必须是 {value}")
    private Integer status;

    @Schema(description = "退款状态：0-未退款、10-部分退款、20-全部退款", example = "0")
    @InEnum(value = TradeOrderRefundStatusEnum.class, message = "退款状态必须是 {value}")
    private Integer refundStatus;

    @Schema(description = "支付渠道", example = "wx_lite")
    private String payChannelCode;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    @Schema(description = "订单来源", example = "10")
    @InEnum(value = TerminalEnum.class, message = "订单来源 {value}")
    private Integer terminal;

}
